package org.example.lethear.dto.post;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Size;
import java.util.List;

/**
 * 帖子查询请求DTO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PostQueryRequest {
    
    /**
     * 关键词搜索
     */
    @Size(max = 100, message = "关键词长度不能超过100个字符")
    private String keyword;
    
    /**
     * 分类ID
     */
    private Long categoryId;
    
    /**
     * 标签列表
     */
    private List<String> tags;
    
    /**
     * 作者ID
     */
    private Long authorId;
    
    /**
     * 作者用户名
     */
    @Size(max = 50, message = "作者用户名长度不能超过50个字符")
    private String authorUsername;
    
    /**
     * 帖子状态
     */
    private Integer status;
    
    /**
     * 是否置顶
     */
    private Boolean isTop;
    
    /**
     * 是否允许评论
     */
    private Boolean allowComment;
    
    /**
     * 排序方式: createdAt, viewCount, likeCount, commentCount
     */
    private String sortBy = "createdAt";
    
    /**
     * 排序方向: ASC, DESC
     */
    private String sortOrder = "DESC";
    
    /**
     * 页码
     */
    @Min(value = 1, message = "页码必须大于等于1")
    private Integer page = 1;
    
    /**
     * 每页数量
     */
    @Min(value = 1, message = "每页数量必须大于等于1")
    private Integer size = 10;
} 